function y = tr2rpy_Tsai(R_dot)
% Tsai convention: R_matrix = rotz_gm*roty_beta*rotx_alf
% return: also Z-Y-X angles

% Tsai angle: 
beta = asin(-R_dot(3,1));
alf = atan2(R_dot(3,2)/cos(beta), R_dot(3,3)/cos(beta));
gm = atan2(R_dot(2,1)/cos(beta), R_dot(1,1)/cos(beta));


y = [gm beta alf];
% angles = [alf beta gm]/pi*180

end